import request from '@/utils/request'

// 查询题库列表
export function listBank(query) {
  return request({
    url: '/teacher/bank/list',
    method: 'get',
    params: query
  })
}

// 查询题库详细
export function getBank(id) {
  return request({
    url: '/teacher/bank/' + id,
    method: 'get'
  })
}

// 新增题库
export function addBank(data) {
  return request({
    url: '/teacher/bank',
    method: 'post',
    data: data
  })
}

// 修改题库
export function updateBank(data) {
  return request({
    url: '/teacher/bank',
    method: 'put',
    data: data
  })
}

// 删除题库
export function delBank(data) {
  return request({
    url: '/teacher/bank/deleteOne',
    method: 'delete',
    data
  })
}


// 批量删除
export function delBankByIds(ids) {
  return request({
    url: '/teacher/bank/batch',
    method: 'delete',
    params: {
      ids
    }
  })
}

// 恢复题库
export function restoreBank(id) {
  return request({
    url: `/api/teacher/bank/restore/${id}`,
    method: 'put',
  });
}
